package pojo;

import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Past;
import java.util.Date;


/**
 * SysUser
 *
 * @author boy
 * @since 2023/10/18
 */
public class SysUser {
    private Integer id;

    public SysUser(Integer id, String account, String realName, String password, Integer sex, Date birthday, String phone, String address, Integer roleId, Integer createdUserId, Date createdTime, Integer updateUserId, Date updateIime, Integer age, String roleIdName, String idPicPath, String workPicPath) {
        this.id = id;
        this.account = account;
        this.realName = realName;
        this.password = password;
        this.sex = sex;
        this.birthday = birthday;
        this.phone = phone;
        this.address = address;
        this.roleId = roleId;
        this.createdUserId = createdUserId;
        this.createdTime = createdTime;
        this.updateUserId = updateUserId;
        this.updateIime = updateIime;
        this.age = age;
        RoleIdName = roleIdName;
        this.idPicPath = idPicPath;
        this.workPicPath = workPicPath;
    }

    @NotEmpty(message = "用户编码不能为空")
    private String account;
@NotEmpty(message = "用户名称不能为空")
    private String realName;
@NotNull(message = "密码不能为空")
@Length(min = 6,max = 10,message = "用户密码长度为6-10")
    private String password;
    private Integer sex;
    @Past(message = "必须是一个过去的时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    private String phone;
    private String address;
    private Integer roleId;
    private Integer createdUserId;
    private Date createdTime;
    private Integer updateUserId;
    private Date updateIime;
    private Integer age;
    private String RoleIdName;
    private String idPicPath;//证件照路径
    private String workPicPath;//工作证照片路径

    public SysUser(Integer id, String account, String realName, String password, Integer sex, Date birthday, String phone, String address, Integer roleId, Integer createdUserId, Date createdTime, Integer updateUserId, Date updateIime, Integer age, String roleIdName) {
        this.id = id;
        this.account = account;
        this.realName = realName;
        this.password = password;
        this.sex = sex;
        this.birthday = birthday;
        this.phone = phone;
        this.address = address;
        this.roleId = roleId;
        this.createdUserId = createdUserId;
        this.createdTime = createdTime;
        this.updateUserId = updateUserId;
        this.updateIime = updateIime;
        this.age = age;
        RoleIdName = roleIdName;
    }

    public SysUser(int id, String zhaojing, String 赵静, String password, int sex, String s, String 上海宝山区, int i, int roleId, Date date, int i1, Date date1) {}

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }

    public Integer getCreatedUserId() {
        return createdUserId;
    }

    public void setCreatedUserId(Integer createdUserId) {
        this.createdUserId = createdUserId;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Integer getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Integer updateUserId) {
        this.updateUserId = updateUserId;
    }

    public Date getUpdateIime() {
        return updateIime;
    }

    public void setUpdateIime(Date updateIime) {
        this.updateIime = updateIime;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "SysUser{" +
                "id=" + id +
                ", account='" + account + '\'' +
                ", realName='" + realName + '\'' +
                ", password='" + password + '\'' +
                ", sex=" + sex +
                ", birthday=" + birthday +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", roleId=" + roleId +
                ", createdUserId=" + createdUserId +
                ", createdTime=" + createdTime +
                ", updateUserId=" + updateUserId +
                ", updateIime=" + updateIime +
                ", age=" + age +
                '}';
    }


    public String getRoleIdName() {
        return RoleIdName;
    }

    public void setRoleIdName(String roleIdName) {
        RoleIdName = roleIdName;
    }

    public String getIdPicPath() {
        return idPicPath;
    }

    public void setIdPicPath(String idPicPath) {
        this.idPicPath = idPicPath;
    }

    public String getWorkPicPath() {
        return workPicPath;
    }

    public void setWorkPicPath(String workPicPath) {
        this.workPicPath = workPicPath;
    }

}
